package com.thinkgsp.jxc.service;

import java.sql.Date;
import java.util.List;

import com.thinkgsp.jxc.model.RpAPayBill;
import com.thinkgsp.jxc.model.RpARecBill;
import com.thinkgsp.jxc.model.RpArpBill;
import com.thinkgsp.jxc.persistence.BillMapper;
import com.thinkgsp.jxc.persistence.ContactBalanceMapper;
import com.thinkgsp.jxc.persistence.RpArpBillMapper;
import com.thinkgsp.jxc.persistence.RpContactMapper;
import com.thinkgsp.jxc.persistence.mybatis.PagingResult;

/**
 * 应收应付单业务类
 * @author evan
 *
 */
public interface RpArpBillService extends RpService {

	/**
	 * 本方法用于测试目的
	 * @param arpBillMapper
	 */
	public void setRpArpBillMapper(RpArpBillMapper arpBillMapper);
	/**
	 * 本方法用于测试目的
	 * @param contactMapper
	 */
	public void setRpContactMapper(RpContactMapper contactMapper);
	/**
	 * 本方法用于测试目的
	 * @param cbMapper
	 */
	public void setContactBalanceMapper(ContactBalanceMapper cbMapper);
	
	/**
	 * 本方法用于测试目的
	 * @param billMapper
	 */
	public void setBillMapper(BillMapper billMapper);
	/**
	 * 根据id获取应收应付单
	 * @param id
	 * @return
	 */
	public <T extends RpArpBill> T getArpBill(Long id);
	
	/**
	 * 根据出入库单据获取应收应付单
	 * @param stockBillId
	 * @return
	 */
	public <T extends RpArpBill> T getArpBillFromStockBill(Long stockBillId);
	
	/**
	 * 获取应收单列表
	 * @param begDate
	 * @param endDate
	 * @return
	 */
	public List<RpARecBill> getARecBillList(Date begDate,Date endDate);
	
	/**
	 * 获取应收单列表(分页)
	 * @param begDate
	 * @param endDate
	 * @param start
	 * @param size
	 * @return
	 */
	public PagingResult<RpARecBill> getARecBillList(Date begDate,Date endDate,int start,int size);
	
	/**
	 * 获取应收单列表
	 * @param begDate
	 * @param endDate
	 * @param custId
	 * @return
	 */
	public List<RpARecBill> getARecBillList(Date begDate,Date endDate,Integer custId);
	/**
	 * 获取应收单列表(分页)
	 * @param begDate
	 * @param endDate
	 * @param start
	 * @param size
	 * @return
	 */
	public PagingResult<RpARecBill> getARecBillList(Date begDate,Date endDate,Integer custId,int start,int size);	
	/**
	 * 获取应付单列表
	 * @param begDate
	 * @param endDate
	 * @return
	 */
	public List<RpAPayBill> getAPayBillList(Date begDate,Date endDate);
	
	/**
	 * 获取应付单列表(分页)
	 * @param begDate
	 * @param endDate
	 * @param start
	 * @param size
	 * @return
	 */
	public PagingResult<RpAPayBill> getAPayBillList(Date begDate,Date endDate,int start,int size);
	
	/**
	 * 获取应付单列表
	 * @param begDate
	 * @param endDate
	 * @param custId
	 * @return
	 */
	public List<RpAPayBill> getAPayBillList(Date begDate,Date endDate,Integer custId);
	/**
	 * 获取应付单列表(分页)
	 * @param begDate
	 * @param endDate
	 * @param start
	 * @param size
	 * @return
	 */
	public PagingResult<RpAPayBill> getAPayBillList(Date begDate,Date endDate,Integer custId,int start,int size);	
	
	/**
	 * 根据入库单创建应付单
	 * @param stkBillId
	 */
	public Long createAPayBillFromStockInBill(Long stkBillId) throws ServiceException;
	
	/**
	 * 根据出库单创建应收单
	 * @param stkBillId
	 */
	public Long createARecBillFromStockOutBill(Long stkBillId) throws ServiceException;
	
}
